﻿using MCP.Model.Repositories.Interfaces;
using System.Web.Mvc;

namespace MoneyCounter.Controllers
{
	public abstract class BaseControllerWithDatasource : Controller
	{
	    internal IUnitOfWork unitOfWork;

	    protected BaseControllerWithDatasource(IUnitOfWork unitOfWork)
        {
            this.unitOfWork = unitOfWork;
        }

		#region IDisposable

		protected override void Dispose(bool disposing)
		{
			this.unitOfWork.Dispose();
			base.Dispose(disposing);
		}

		#endregion
	}
}